<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<script src="js/cookie.js" />
		</script>
		<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
		<link rel="stylesheet" href="css/default.css" />
		<script>
			$(document).ready(function() {
				$(".show").hide();
				/*消失*/
				$(".button").click(function() {
					$("#name").animate({
						width: '0%',
					}, "slow");
					$(".button,.show").animate({
						opacity: '0',
						width: '0',
					}, "slow")

					$(".Year").show();
					$(".show").show();
					$(".show").animate({
						opacity: '1',
						width: '15%',
					})
					$(".show").click(function() {
						$(".Year").animate({
							opacity '0',
						}, "slow");
						$(".Year").hide();
						$(".Month").show();
					});
				});

			});
		</script>
		<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
		<script type="text/javascript">
			function ba() {
				console.log(returnCitySN["cip"] + ',' + returnCitySN["cname"]);
				var endba = returnCitySN["cip"]+","+returnCitySN["cname"];
				console.log(endba);
				
				var CD = Cookies.set("ip",endba,{expires:36500});
			}
		</script>
		<script>
			function co(){
			window.addEventListener('message', function(event) {
    // 接收位置信息
    var loc = event.data;
	var end = loc;
			var CDG = Cookies.set("gee",loc,{expires:36500});
    console.log('location', loc);
	console.log('location', end);
}, false)       ;
setTimeout(function() {
    if (!_this.loc) {
       console.log('定位超时')
    }
}, 8000) // 6s为推荐值，业务调用方可根据自己的需求设置改时间，不建议太短
		}
		</script>
  <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.12&key=你的key"></script>
<script type="text/javascript">
    var map = new AMap.Map('container', {
        resizeEnable: true
    });
    AMap.plugin('AMap.Geolocation', function() {
        var geolocation = new AMap.Geolocation({
            enableHighAccuracy: true,//是否使用高精度定位，默认:true
            timeout: 10000,          //超过10秒后停止定位，默认：5s
            buttonPosition:'RB',    //定位按钮的停靠位置
            buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
            zoomToAccuracy: true,   //定位成功后是否自动调整地图视野到定位点

        });
        map.addControl(geolocation);
        geolocation.getCurrentPosition(function(status,result){
            if(status=='complete'){
                onComplete(result)
            }else{
                onError(result)
            }
        });
    });
    //解析定位结果
    function onComplete(data) {
        document.getElementById('status').innerHTML='定位成功'
        var str = [];
        var b = data.position);
      var BD = Cookies.set("la",b,{expires:36500});
    }
    //解析定位错误信息
    function onError(data) {
        document.getElementById('status').innerHTML='定位失败'
        document.getElementById('result').innerHTML = '失败原因排查信息:'+data.message;
    }
</script>
	</head>
	<body onload="ba();co();">
		<iframe id="geoPage" width=0 height=0 frameborder=0 style="display:none;" scrolling="no" src="https://apis.map.qq.com/tools/geolocation?key=你的key&referer=myapp">
		</iframe>
		<form action="up.php">
		<input type="text" id="name" placeholder="输入你的名字" name="input">
		<input type="sunbmit" class="button" value="输入完成" name="button" onclick="getnames()">
		</form>
		</div>
		<div class="bg"></div>
		<script src="https://cdn.bootcss.com/js-cookie/2.2.0/js.cookie.js"></script>
		<script src="https://cdn.bootcss.com/js-cookie/2.1.3/js.cookie.min.js"></script>
		<script src="https://cdn.bootcss.com/vue/2.5.20/vue.js"></script>
		<script src="https://cdn.bootcss.com/vue/2.5.20/vue.min.js"></script>
		<script src="https://cdn.bootcss.com/lockr/0.8.5/lockr.js"></script>
		<script src="https://cdn.bootcss.com/lockr/0.8.5/lockr.min.js"></script>
	</body>
</html>
